package com.bnz.consumer.listener;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "zhangsan")
public class ConsumerListener01 {
    // 使用direct模式接收消息
    @RabbitHandler
    public void getMessage(String msg){
        System.out.println("接收到消息 ： " + msg);
    }
}
